<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AltreTableOpenShopMainProcessAddLocationChiled extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_main_process', function (Blueprint $table) {
            $table->unsignedBigInteger('childLocationOrder')->default(0)->after("childOrder")
                  ->comment("选址 0主订单 1子订单");
            $table->unsignedBigInteger('locationPid')->default(0)->after("childOrder")
                  ->comment("迁址 main 表id");
        });

//        \App\Models\OpenShop\InvestmentPromotion\OpenShopMainProcessModel::query()->update([
//            'childLocationOrder' => 0,
//
//        ]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_main_process', function (Blueprint $table) {
            $table->dropColumn('childLocationOrder');
            $table->dropColumn('locationPid');
        });
    }
}
